package com.lgx.right.service;

import java.util.List;

import com.lgx.common.exception.DataException;
import com.lgx.common.tree.easyui.TreeModel;
import com.lgx.right.entity.Permission;

public interface IPermissionService {

	public Permission createPermission(Permission permission) throws DataException;
	public Permission updatePermission(Permission permission) throws DataException;
	public void deletePermission(Permission permission) throws DataException;
	public void deletePermission(long id) throws DataException;
	
	public Permission findPermissionById(long id) ;
	public List<Permission> findPermissionList(String sql);
	public List<Permission> findPermissionList();
	
	
	
	/**
	 * 获取用户的权限
	 * 
	 * @param userId 用户ID
	 * @param type 权限类型
	 * @return
	 */
	public List<Permission> findPermissionList(long userId,String type);
	
	/**
	 * 
	 * @return
	 */
	public List<TreeModel> findPermissionTreeList();
	
	/**
	 * 
	 * @return
	 */
	public List<TreeModel> findPermissionRoleTreeList(long roleId); 
	
	/**
	 * 
	 * @param ids
	 * @return
	 */
	public List<Permission> findPermissionByIds(String ids);
}
